<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap 101 Template</title>


    <!-- Bootstrap -->
    <!--<link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">-->
    <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.css">

    <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/comunity.css">


    <script src="bootstrap-3.3.7-dist/jquery-3.3.1/jquery-3.3.1.min.js"></script>

    <script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>


</head>
<body class="Index-body">
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">麻将社区</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

            <form class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="搜索问答">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li th:if="${session.user==null}"><a
                        href="https://gitee.com/oauth/authorize?client_id=085212331519abc0b94ce2ad1fa3380e176a45dabab74617b424fc7a343e1998&redirect_uri=http://localhost:8080/callback&response_type=code&state=1">登录</a>
                </li>
                <li th:if="${session.user!=null}">
                    <a href="/public">发布</a>
                </li>
                <li class="dropdown" th:if="${session.user!=null}">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false" th:text="${session.user.getName()}"> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">个人中心</a></li>
                        <li><a href="#">消息中心</a></li>
                        <li><a href="#">退出登录</a></li>

                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div class="container-fluid main">

    <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
        <h2><span class="glyphicon glyphicon-list" aria-hidden="true"></span>发现</h2>
        <hr>
        <div class="media" th:each="question : ${pagination.questions}">
            <div class="media-left">
                <a href="#">
                    <img class="media-object img-rounded avatarUrl" th:src="${question.user.avatarUrl}">
                </a>

            </div>
            <div class="media-body">
                <h4 class="media-heading" th:text="${question.titile}"></h4>
                <span th:text="${question.description}"></span></br>
                <span class="text-desc"><span th:text="${question.comment_count}"></span> 个回复 •<span
                        th:text="${question.view_count}"></span> 次浏览 •
                <span th:text="${#dates.format(question.gmt_creat,'yyyy-MM-dd HH:mm')}"></span></span>
            </div>
        </div>

        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li th:if="${pagination.showPrevious}">
                    <a href="#" aria-label="Previous">
                        <span aria-hidden="true">&lt;</span>
                    </a>
                </li>

                <li th:if="${pagination.showFirstPage}">
                    <a href="#" aria-label="Previous">
                        <span aria-hidden="true">&lt;&lt;</span>
                    </a>
                </li>
                <li th:each="page : ${pagination.pages}" th:class="${pagination.page==page}?'active':''">
                    <a th:href="@{/(page=${page})}" href="/" th:text="${page}"  ></a>
                </li>


                <li>
                    <a href="#" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>


    </div>
    <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
        <h3>热门话题</h3>


    </div>
</div>

</body>
</html>